//
//  LYTempViewController.swift
//  Swift---新浪微博练习代码
//
//  Created by Mr.Yan on 2017/6/30.
//  Copyright © 2017年 Mr.Yan. All rights reserved.
//

import UIKit

class LYTempViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        setupUI()
    }
    private func setupUI(){
    
        view.backgroundColor = UIColor.white
        setupNav()
    }
    private func setupNav(){
    
        //title
        navigationItem.title = "第\(navigationController?.childViewControllers.count ?? 0)个控制器"
        //PUSH
        navigationItem.rightBarButtonItem = UIBarButtonItem(imageName: nil, title: "PUSH", tager: self, action: #selector(pushClick))
    }
//    @objc  runloop循环时可以检测到点击事件方法
  @objc  private func pushClick(){
    
       let tempVC = LYTempViewController()
    navigationController?.pushViewController(tempVC, animated: true)
    }
}
